/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cat20032010;

import java.sql.*;

/**
 *
 * @author Daniel Tan
 */
public class Main {
static String url = "jdbc:oracle:thin:@localhost:1521:XE";
    public static Connection con;
    public static String userid = "CAT";
    public static String password = "200";
    public static Connection getConnection() {

        try {
          //  Class.forName("oracle.jdbc.OracleDriver");
            Class.forName("oracle.jdbc.OracleDriver");
        } catch (java.lang.ClassNotFoundException e) {
            System.err.print("ClassNotFoundException: ");
            System.err.println(e.getMessage());
        }

        try {

         //   DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
            con = DriverManager.getConnection(url, userid, password);

        } catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
        }

        return con;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
    }

}
